package demo3;



interface IShape {
    public static final int a = 10;
    public abstract void draw();

    default public void test() {
        //定义方法
    }
    public static void test2() {
        System.out.println("方法2");
    }
}
class Rect implements IShape {
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}
class Flower implements IShape {
    @Override
    public void draw() {
        System.out.println("🌸");
    }
}
public class TestDemo {
    public static void drawMap(IShape iShape) {
        iShape.draw();

//        IShape iShape  = new IShape() {
//            @Override
//            public void draw() {
//
//            }
//        }

    }

    public static void main(String[] args) {
        drawMap(new Rect());
        drawMap(new Flower());

    }

}
